package designpatterns.mediator;

/**
 * 中介者模式（Mediator）‌
 * 又叫“调停”模式，定义一个中介对象来封装一系列对象之间的交互，使原有对象之间的耦合松散，且可以独立地改变它们之间的交互。
 * 封装对象交互，减少网状依赖。‌
 */
public class Client {
    public static void main(String[] args) {
        Mediator mediator = new Mediator1();
        Colleague colleague1 = new Colleague1();
        Colleague2 colleague2 = new Colleague2();
        mediator.register(colleague1);
        mediator.register(colleague2);
        colleague1.send();
        System.out.println("----------------------------------");
        colleague2.send();
    }
}
